﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

using System.Data.SQLite;

namespace Classes
{
   public class Office : IComparable<Office>
   {
      #region Private Member Variables
      
      private String id, location, season, sales, tech;
      
      #endregion
      
      #region Properties
      
      public String ID        { get { return id; } }
      public String Location  { get { return location; } }
      public String Season    { get { return season; } }
      public String Manager   { get { return sales; } }
      public String LeadTech  { get { return tech; } }
      public String Display   { get { return location + ", " + season; } }
      
      #endregion
      
      #region Constructors
      
      public Office(SQLiteDataReader iOffice)
      {
         id       = (String)iOffice["id"];
         location = (String)iOffice["location"];
         season   = (String)iOffice["year"];
         sales    = (String)iOffice["sales"];
         tech     = (String)iOffice["tech"];
      }
      
      #endregion

      #region CompareTo Functions

      public int CompareTo(Office b)
      {
         if (this.season.Equals(b.season))
            return this.Location.CompareTo(b.Location);
         else return this.season.CompareTo(b.season);
      }

      #endregion
   }
}
